home *** CD-ROM | disk | FTP | other *** search
/ PC Open 100 / PC Open 100 CD 1.bin / CD1 / INTERNET / WEBDESIGN / Tsw WebCoder / tswwebcoder5en.exe / {app} / data / tools / dialog_body.xml < prev    next >
Encoding:
Extensible Markup Language  |  2004-06-07  |  13.5 KB  |  223 lines

  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <dialog width="500" height="450" caption="New page">
  3.     <controls>
  4.         <panel name="mainpanel" caption="" align="alclient" bevelinner="bvnone" bevelouter="bvnone">
  5.             <panel name="pnlTop" caption="" taborder="0" hint="" width="615" height="96" top="1" left="1" bevelinner="bvnone" bevelouter="bvnone">
  6.                 <label name="lblDoctype" caption="Documenttype" hint="Enter a doctype for your document. Will be used e.g. when validating your document at w3.org or through WebCoder." width="69" height="13" top="8" left="10"/>
  7.                 <label name="lblStylesheet" caption="Stylesheet" hint="If you wish for your document to link to a stylesheet, you can do it here." width="88" height="13" top="56" left="250"/>
  8.                 <label name="lblTitle" caption="Title" hint="Enter a title. The title of a document is displayed as caption in the browser window." width="24" height="13" top="56" left="8"/>
  9.                 <combobox name="comDocumentType" taborder="0" text="<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">" hint="Enter a doctype for your document. Will be used e.g. when validating your document at w3.org or through WebCoder." width="447" height="21" top="24" left="10">
  10.                     <items>
  11.                         <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  12.                         <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  13.                         <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">                    
  14.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  15.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  16.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">            
  17.                         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  18.                     </items>
  19.                 </combobox>
  20.                 <edit name="edtStylesheet" taborder="2" text="" hint="If you wish for your document to link to a stylesheet, you can do it here." width="190" height="19" top="72" left="250"/>
  21.                 <speedbutton name="btnSearchForStylesheet" glyph="icons\16x16\look_for_files.bmp" caption="" taborder="3" hint="Look on the computer for a stylesheet." width="19" height="19" top="72" left="442">
  22.                     <event type="onclick">
  23.                         sOpenDialog := TOpenDialog.Create(Self);
  24.                         sOpenDialog.Filter := 'CSS Files (*.css)|*.css';
  25.                         If sOpenDialog.Execute then
  26.                          edtStylesheet.Text := GetRelativePath('', sOpenDialog.FileName);
  27.                         sOpenDialog.Free;                        
  28.                     </event>
  29.                 </speedbutton>
  30.                 <edit name="edtTitle" taborder="1" text="" hint="Enter a title. The title of a document is displayed as caption in the browser window." width="210" height="19" top="72" left="8"/>
  31.             </panel>
  32.             <panel name="pnlBottom" caption="" taborder="1" hint="" width="615" height="191" top="97" left="1" bevelinner="bvnone" bevelouter="bvnone">
  33.                 <label name="lblBackgroundColor" caption="Background color" hint="Select a background color for your document." width="75" height="13" top="32" left="8"/>
  34.                 <label name="lblLinkColor" caption="Link color" hint="Select a color for links in your document." width="47" height="13" top="72" left="8"/>
  35.                 <label name="lblVisitedLinkColor" caption="Visited link color" hint="Select a color for visited links in your document." width="79" height="13" top="112" left="120"/>
  36.                 <label name="lblActiveLinkColor" caption="Active link color" hint="Select a color for active links in your document." width="73" height="13" top="72" left="120"/>
  37.                 <label name="lblTextColor" caption="Text color" hint="Select a color for text in your document." width="54" height="13" top="32" left="120"/>
  38.                 <label name="lblOverview" caption="Overview" hint="" width="39" height="13" top="72" left="250"/>
  39.                 <label name="lblBackgroundImage" caption="Background image" hint="Select a background image, if you wish to use an image as background of your document." width="98" height="13" top="32" left="250"/>
  40.                 <coloredit name="cleBackgroundColor" taborder="0" text="#FFFFFF" hint="Select a background color for your document." width="100" height="19" top="48" left="8">
  41.                     <event type="onchange" callFunction="UpdateColorPanel"/>
  42.                 </coloredit>                    
  43.                 <coloredit name="cleTextColor" taborder="1" text="#000000" hint="Select a color for text in your document." width="100" height="19" top="48" left="120">
  44.                     <event type="onchange" callFunction="UpdateColorPanel"/>
  45.                 </coloredit>                    
  46.                 <coloredit name="cleLinkColor" taborder="2" text="#0000FF" hint="Select a color for links in your document." width="100" height="19" top="88" left="8">
  47.                     <event type="onchange" callFunction="UpdateColorPanel"/>
  48.                 </coloredit>                    
  49.                 <coloredit name="cleActiveLinkColor" taborder="3" text="#000080" hint="Select a color for active links in your document." width="100" height="19" top="88" left="120">
  50.                     <event type="onchange" callFunction="UpdateColorPanel"/>
  51.                 </coloredit>                    
  52.                 <coloredit name="cleVisitedLinkColor" taborder="4" text="#800080" hint="Select a color for visited links in your document." width="100" height="19" top="128" left="120">
  53.                     <event type="onchange" callFunction="UpdateColorPanel"/>
  54.                 </coloredit>                    
  55.                 <shape name="shpPreviewArea" width="212" height="91" top="87" left="250"/>
  56.                 <panel name="pnlPreview" caption="" taborder="7" hint="" width="210" height="89" top="88" left="251" bevelinner="bvnone" bevelouter="bvnone" color="clwhite">
  57.                     <label name="lblPreviewTextColor" fontcolor="clblack" caption="Text" hint="" width="27" height="13" top="8" left="8"/>
  58.                     <label name="lblPreviewLinkColor" fontcolor="clblue" caption="Link" hint="" width="20" height="13" top="28" left="8"/>
  59.                     <label name="lblPreviewActiveLinkColor" fontcolor="clnavy" caption="Active link" hint="" width="46" height="13" top="48" left="8"/>
  60.                     <label name="lblPreviewVisitedLinkColor" fontcolor="clpurple" caption="Visited link" hint="" width="52" height="13" top="68" left="8"/>
  61.                 </panel>
  62.                 <edit name="edtBackgroundImage" taborder="5" text="" hint="Select a background image, if you wish to use an image as background of your document." width="190" height="19" top="48" left="250"/>
  63.                 <speedbutton name="btnSearchForBackgroundImage" glyph="icons\16x16\look_for_files.bmp" caption="" taborder="6" hint="Look on the computer for an image file." width="19" height="19" top="48" left="442">
  64.                     <event type="onclick">
  65.                         Dlg := TOpenPictureDialog.Create(nil);    
  66.                         ImageExtensions := GetImageTypes();
  67.                         Dlg.Filter := 'Image files ('+ImageExtensions+')|'+ImageExtensions;
  68.                           If Dlg.Execute then
  69.                          edtBackgroundImage.Text := GetRelativePath('', Dlg.FileName);
  70.                         Dlg.Free;    
  71.                     </event>
  72.                 </speedbutton>                    
  73.                 <checkbox name="cbIncludeBody" caption="Generate <body> tag" taborder="8" hint="Select whether WebCoder should generate the <body> tag for you, using colors etc." checked="1" width="225" height="17" top="8" left="8"/>
  74.             </panel>
  75.         </panel>
  76.     </controls>
  77.     <dialogfunctions>
  78.         function AddCodeFromAdvancedPanel : string;
  79.          begin
  80.           ACode := '';
  81.             If edtCSSClass.Text <> '' then
  82.            ACode := ACode + ' class="'+edtCSSClass.Text+'"';
  83.           If edtCSSId.Text <> '' then
  84.            ACode := ACode + ' ID="'+edtCSSId.Text+'"';
  85.           If edtCSSStyle.Text <> '' then
  86.            ACode := ACode + ' style="'+edtCSSStyle.Text+'"';
  87.  
  88.           for i := 0 to EventGrid.Count - 1 do
  89.             begin
  90.             if EventGrid.Rows[i].EditText <> '' then
  91.              ACode := ACode + ' ' + (EventGrid.Rows[i].Caption+'="' + EventGrid.Rows[i].EditText)+'"';
  92.            end;               
  93.           Result := ACode; 
  94.          end;    
  95.         procedure UpdateColorPanel;
  96.         begin
  97.          lblPreviewTextColor.Font.Color := cleTextColor.SelColor;
  98.          lblPreviewLinkColor.Font.Color := cleLinkColor.SelColor;
  99.          lblPreviewActiveLinkColor.Font.Color := cleActiveLinkColor.SelColor;
  100.          lblPreviewVisitedLinkColor.Font.Color := cleVisitedLinkColor.SelColor;
  101.          pnlPreview.Color := cleBackgroundColor.SelColor;
  102.         end;          
  103.     </dialogfunctions>
  104.     <dialogevents>
  105.         <event type="onclose" resulttype="ok">
  106.  
  107.             br := #13#10;
  108.             StartCode := '<body';
  109.             If cbUpdateExistingTag.Checked then
  110.               begin
  111.                 if edtBackgroundImage.Text > '' then
  112.                StartCode := ' background="'+(edtBackgroundImage.Text)+'"';
  113.               StartCode := StartCode + ' bgcolor="'+cleBackgroundColor.HTMLValue+'" text="'+cleTextColor.HTMLValue+'" link="'+cleLinkColor.HTMLValue+'" vlink="'+cleVisitedLinkColor.HTMLValue+'" alink="'+cleActiveLinkColor.HTMLValue+'"';
  114.               StartCode := StartCode + AddCodeFromAdvancedPanel();
  115.                EndCode := '>';
  116.              end
  117.             else
  118.              begin
  119.                  StartCode := comDocumentType.Text+br;
  120.                  StartCode := StartCode + '<html>'+br+'<head>'+br;
  121.  
  122.               If edtTitle.Text <> '' then
  123.                StartCode := StartCode + #9+'<title>'+edtTitle.Text+'</title>'+br
  124.               else
  125.                StartCode := StartCode + #9+'<title>Nyt dokument</title>'+br;
  126.  
  127.               If edtStylesheet.Text <> '' then
  128.                StartCode := StartCode + #9+'<link rel="stylesheet" type="text/css" href="'+edtStylesheet.Text+'">'+br;
  129.               StartCode := StartCode + '</head>'+br;
  130.  
  131.                  If cbIncludeBody.Checked then
  132.                begin
  133.                  StartCode := StartCode + '<body';
  134.                  If edtBackgroundImage.Text <> '' then
  135.                   StartCode := StartCode + ' background="'+edtBackgroundImage.Text+'"';
  136.                  If cleBackgroundColor.HTMLValue <> '#FFFFFF' then
  137.                   StartCode := StartCode + ' bgcolor="'+cleBackgroundColor.HTMLValue+'"';
  138.                  If cleTextColor.HTMLValue <> '#000000' then
  139.                    StartCode := StartCode + ' text="'+cleTextColor.HTMLValue+'"';
  140.                 If cleLinkColor.HTMLValue <> '#0000FF' then
  141.                  StartCode := StartCode + ' link="'+cleLinkColor.HTMLValue+'"';
  142.                 If cleActiveLinkColor.HTMLValue <> '#000080' then
  143.                  StartCode := StartCode + ' alink="'+cleActiveLinkColor.HTMLValue+'"';
  144.                 If cleVisitedLinkColor.HTMLValue <> '#800080' then
  145.                  StartCode := StartCode + ' vlink="'+cleVisitedLinkColor.HTMLValue+'"';
  146.                 
  147.                 StartCode := StartCode + AddCodeFromAdvancedPanel()+'>';
  148.                end
  149.               else
  150.                StartCode := StartCode + '<body>';
  151.               StartCode := StartCode + br+br;
  152.               EndCode := br;
  153.               EndCode := EndCode + '</body>'+br+'</html>';
  154.               end;
  155.             Code := StartCode+EndCode;
  156.  
  157.             If cbMakeXHTMLCompliant.Checked then
  158.              Code := MakeXHTMLCompliant(Code, true);
  159.             If cbDoPHPEscape.Checked then
  160.              Code := DoPHPEscape(Code);         
  161.             // A little "hack" - WebCoder will set this, to let us know whether to update
  162.             // an existing tag, or insert a brand new one
  163.             If cbUpdateExistingTag.Checked then 
  164.              ReplaceTag(Code)
  165.             else 
  166.                InsertTags(StartCode, EndCode);   
  167.               
  168.         </event>
  169.         <event type="onshow">    
  170.             If cbUpdateExistingTag.Checked then
  171.              begin
  172.               pnlTop.Visible := false;
  173.               Self.Height := Self.Height-pnlTop.Height;
  174.               cbIncludeBody.Visible := false;              
  175.               pnlBottom.Top := 1;
  176.              end;
  177.             // Lets put the advanced panel in the right place
  178.             pnlAdvanced.Parent := MainPanel;
  179.             pnlAdvanced.Left := 8;
  180.             pnlAdvanced.Top := MainPanel.Height - 32;        
  181.             pnlAdvanced.Width := Self.Width - 36;      
  182.             // Height of the panel will be set internally. Do we need to make the dialog higher to make room for the Advanced panel?
  183.             If pnlAdvanced.Height > 20 then
  184.              Self.Height := Self.Height + 200;
  185.              
  186.         </event>
  187.         <event type="updatedialog">
  188.             // This event will be called when a user executes the "Edit current tag"-rightclick feature
  189.             // The entire selected tag will be passed as a parameter to this function, that should update
  190.             // the required fields of the dialog.
  191.             function UpdateDialog(Tag: string);
  192.              begin  
  193.               If GetValueFromAttribute(Tag, 'bgcolor') <> '' then
  194.                cleBackgroundColor.SelColor := ConvertColor(GetValueFromAttribute(Tag, 'bgcolor'));             
  195.               If GetValueFromAttribute(Tag, 'text') <> '' then
  196.                cleTextColor.SelColor := ConvertColor(GetValueFromAttribute(Tag, 'text'));
  197.               If GetValueFromAttribute(Tag, 'link') <> '' then
  198.                cleLinkColor.SelColor := ConvertColor(GetValueFromAttribute(Tag, 'link'));
  199.               If GetValueFromAttribute(Tag, 'alink') <> '' then
  200.                cleActiveLinkColor.SelColor := ConvertColor(GetValueFromAttribute(Tag, 'alink'));
  201.               If GetValueFromAttribute(Tag, 'vlink') <> '' then
  202.                cleVisitedLinkColor.SelColor := ConvertColor(GetValueFromAttribute(Tag, 'vlink'));
  203.                
  204.               edtBackgroundImage.Text := GetValueFromAttribute(Tag, 'background');
  205.               
  206.               UpdateColorPanel();        
  207.             
  208.                 edtCSSClass.Text := GetValueFromAttribute(Tag, 'class');
  209.                 edtCSSId.Text := GetValueFromAttribute(Tag, 'id');
  210.                 edtCSSStyle.Text := GetValueFromAttribute(Tag, 'style');
  211.               for i := 0 to EventGrid.Count - 1 do
  212.                 begin
  213.                  EventVal := GetValueFromAttribute(Tag, Lowercase(EventGrid.Rows[i].Caption));
  214.                  If EventVal <> '' then
  215.                   EventGrid.Rows[i].EditText := EventVal;
  216.                end;  
  217.               cbDoPHPEscape.Checked := IsPHPEscaped(Tag);
  218.               cbMakeXHTMLCompliant.Checked := isXHTMLDocument();                            
  219.              end;
  220.         </event>
  221.     </dialogevents>
  222. </dialog>
  223.